@each $side, $opposite-side in ( left: 'right', right: 'left' ) {
    .icon-#{$side} {
        padding-#{$side}: $btn-padding-x-sm;

        i {
            position: relative;
            float: #{$side} !important;
            min-width: ($btn-padding-x * 1.5);
            line-height: ($btn-padding-x * 5/3);
            padding-#{$opposite-side}: $btn-padding-x-sm;
            margin-#{$opposite-side}: $btn-padding-x;
            border-#{$opposite-side}: 1px solid;
        }

        span {
            line-height: ($btn-padding-x * 5/3);
        }

        &.btn-sm {
            padding-#{$side}: ($btn-padding-x-sm / 2);
            i {
                padding-#{$opposite-side}: ($btn-padding-x-sm / 2);
                margin-#{$opposite-side}: $btn-padding-x-sm;
            }
        }

        &.btn-lg {
            padding-#{$side}: $btn-padding-x;
            i {
                padding-#{$opposite-side}: $btn-padding-x;
                margin-#{$opposite-side}: ($btn-padding-x * 1.5);
            }
        }
    }
}